<?php
/*
 +----------------------------------------------------------------------
 + Title        : Index 控制器
 + Author       : Randy_chen
 + Version      : V1.0.0.1
 + Initial-Time : 2020/4/30 17:52
 + Last-time    : 2020/4/30 17:52+ 86187
 + Desc         : Index
 +----------------------------------------------------------------------
*/


namespace app\service\controller\v1;

use app\api\controller\Base;
use app\facade\Jwt;
use myAnnotation\Annotation\ApiIdempotent;
use myAnnotation\Annotation\RateLimit;

/**
 * 提供第三方服务
 * Class Index
 *
 * @package app\service\controller\v1
 */
class Index extends Base {
    /**
     * 登录(渠道商登录)
     *
     * @author : Randy_chen
     * @Date   : 2020/4/30
     * @Time   : 17:53
     */
    function login() {
//        $data['uid'] = 666666;
//        $res = Jwt::setToken($data);
//        echo  $res; exit;
	    $token = input('token');
	    if ($res = Jwt::check($token)) {
		    dump($res);
	    }
//        dump(Jwt::check($token));

//       01069
    }

    /**
     * @RateLimit(userLimit=1,ipLimit=2 ,scene="ip,user")
     * @ApiIdempotent( expire=120)
     * @author : Randy_chen
     * @Date   : 2020/5/5
     * @Time   : 15:31
     */
    public function test2() {
        $this->success(['aa' => 111222]);
    }


}